#include <FreeRTOS.h>
#include "task.h"
#include "usbh_core.h"
#include "bflb_mtimer.h"
#include "usb_midi.h"
#include "board.h"

#define MIDI_STACK_SIZE     (1536)
#define MIDI_TASK_PRIORITY  (16)

extern void midi_init(void);
extern void midi_test(void);

static TaskHandle_t midi_task_hd;

void midi_task(void *params)
{
    midi_init();
    while(1)
    {
        midi_test();
        bflb_mtimer_delay_ms(500);
    }
}


int main(void)
{
    board_init();

    xTaskCreate(midi_task, "midi", 
        MIDI_STACK_SIZE, NULL, MIDI_TASK_PRIORITY, &midi_task_hd);
    vTaskStartScheduler();
    while (1) {
    }
}
